using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace Viettel.VOFFICE.DAO.Models.Mapping
{
    public class DocumentOutboxMap : EntityTypeConfiguration<DocumentOutbox>
    {
        public DocumentOutboxMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            // Properties
            this.Property(t => t.Code)
                .HasMaxLength(50);

            this.Property(t => t.PaperCode)
                .HasMaxLength(50);

            this.Property(t => t.Abstract)
                .IsRequired()
                .HasMaxLength(1000);

            this.Property(t => t.InnerOfficeIds)
                .HasMaxLength(150);

            this.Property(t => t.OuterOfficeIds)
                .HasMaxLength(150);

            this.Property(t => t.LeadMessage)
                .HasMaxLength(1000);

            // Table & Column Mappings
            this.ToTable("DocumentOutbox");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.Code).HasColumnName("Code");
            this.Property(t => t.PaperCode).HasColumnName("PaperCode");
            this.Property(t => t.Abstract).HasColumnName("Abstract");
            this.Property(t => t.Status).HasColumnName("Status");
            this.Property(t => t.SignerId).HasColumnName("SignerId");
            this.Property(t => t.SignDate).HasColumnName("SignDate");
            this.Property(t => t.PublishDate).HasColumnName("PublishDate");
            this.Property(t => t.DocTypeId).HasColumnName("DocTypeId");
            this.Property(t => t.InnerOfficeIds).HasColumnName("InnerOfficeIds");
            this.Property(t => t.OuterOfficeIds).HasColumnName("OuterOfficeIds");
            this.Property(t => t.LeadMessage).HasColumnName("LeadMessage");
            this.Property(t => t.CreatedAt).HasColumnName("CreatedAt");
            this.Property(t => t.UpdatedAt).HasColumnName("UpdatedAt");
            this.Property(t => t.CreatorId).HasColumnName("CreatorId");
            this.Property(t => t.DepartmentIdCreate).HasColumnName("DepartmentIdCreate");
            this.Property(t => t.EditorId).HasColumnName("EditorId");
            this.Property(t => t.DepartmentEditorId).HasColumnName("DepartmentEditorId");
            this.Property(t => t.Priority).HasColumnName("Priority");
            this.Property(t => t.Security).HasColumnName("Security");
            this.Property(t => t.Importance).HasColumnName("Importance");
            this.Property(t => t.AccessLevel).HasColumnName("AccessLevel");
            this.Property(t => t.DeliveryType).HasColumnName("DeliveryType");
            this.Property(t => t.NumberOfDoc).HasColumnName("NumberOfDoc");
            this.Property(t => t.PageOfDoc).HasColumnName("PageOfDoc");
            this.Property(t => t.CopyFromId).HasColumnName("CopyFromId");
            this.Property(t => t.IsReply).HasColumnName("IsReply");
            this.Property(t => t.ReplyForDocId).HasColumnName("ReplyForDocId");
            this.Property(t => t.IsActive).HasColumnName("IsActive");
            this.Property(t => t.IsFinish).HasColumnName("IsFinish");
        }
    }
}
